Skip to content

Update Microsoft.Data.Sqlite TFMs: replace netstandard2.0 with net472#37877

Open
Copilot wants to merge 3 commits intomainfrom
copilot/update-sqlite-core-tfms
Open

Update Microsoft.Data.Sqlite TFMs: replace netstandard2.0 with net472#37877
Copilot wants to merge 3 commits intomainfrom
copilot/update-sqlite-core-tfms

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

netstandard2.0 implied support for older .NET TFMs (e.g. net8.0) that are no longer supported, and masked the lack of DateOnly/TimeOnly support on those targets. This replaces it with an explicit net472 target for .NET Framework support.

Changes

  • Microsoft.Data.Sqlite.Core.csproj: TargetFrameworks changed from $(NetMinimum);netstandard2.0$(NetMinimum);$(NetFrameworkToolCurrent) (net10.0;net472)

  • Microsoft.Data.Sqlite.csproj (meta-package):

    • TargetFramework=netstandard2.0TargetFrameworks=$(NetMinimum);$(NetFrameworkToolCurrent)
    • Added <Target Name="CheckForAnyCPU" /> to suppress the native SQLite architecture check during CI builds — this packaging-only project performs no native compilation, so the check is irrelevant here; it still fires correctly in end-user projects via buildTransitive
    • Added a CheckNetMinimumLibDirectory build target that emits an error when $(NetMinimum) is no longer net10.0, reminding to rename lib\net10.0 to lib\$(NetMinimum)
  • lib/ placeholders: Replaced lib/netstandard2.0/_._ with lib/net10.0/_._ and lib/net472/_._

The resulting NuGet packages now have explicit net10.0 and .NETFramework4.7.2 dependency groups in the nuspec instead of a single netstandard2.0 group.

Original prompt

This section details on the original issue you should resolve

<issue_title>Update Microsoft.Data.Sqlite.Core TFMs</issue_title>
<issue_description>For .NET 11 we need to consider whether Microsoft.Data.Sqlite.Core should continue to support .NET Framework. And we should drop netstandard2.0 to avoid giving the impression that older TFMs like net8.0 are still supported. So, the final set would be one of:

  • net10.0
  • net10.0;net472
  • net11.0;net10.0
  • net11.0;net10.0;net472</issue_description>

<agent_instructions>Change netstandard2.0 to net472 in Microsoft.Data.Sqlite.Core and other projects</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@roji @AndriySvyryd as per the discussion in https://github.com//pull/35589/files#r1944379793, we also have the option of simply keeping netstandard2.0 and multitargeting to the minimum supported TFM (currently net8.0, for .NET 11 it will be net10.0). @AndriySvyryd Keeping `netstandard2.0` will always result in the situation where an older TFM appears to be supported but suddenly loses `DateOnly` and `TimeOnly` support. @roji > Keeping netstandard2.0 will always result in the situation where an older TFM appears to be supported but suddenly loses DateOnly and TimeOnly support.

That's true - I'm just arguing that we shouldn't have that happened for supported TFMs (e.g. net8.0 currently). What happens to unsupported TFMs seems much less important.</comment_new>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…et472

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Microsoft.Data.Sqlite.Core TFMs for .NET 11 Update Microsoft.Data.Sqlite TFMs: replace netstandard2.0 with net472 Mar 6, 2026
…rectory

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
@AndriySvyryd AndriySvyryd marked this pull request as ready for review March 7, 2026 02:15
@AndriySvyryd AndriySvyryd requested a review from a team as a code owner March 7, 2026 02:15
Copilot AI review requested due to automatic review settings March 7, 2026 02:15
@AndriySvyryd AndriySvyryd assigned roji and unassigned AndriySvyryd and Copilot Mar 7, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Microsoft.Data.Sqlite.Core and Microsoft.Data.Sqlite (the meta-package) to replace their netstandard2.0 target framework moniker with an explicit net472 target, using the Arcade SDK's $(NetFrameworkToolCurrent) property. This change makes it clear that only .NET Framework 4.7.2 and the current minimum supported .NET ($(NetMinimum) = net10.0) are supported, removing the misleading implicit compatibility with older .NET versions like net8.0.

Changes:

  • Microsoft.Data.Sqlite.Core.csproj: Swaps netstandard2.0 for $(NetFrameworkToolCurrent) in TargetFrameworks.
  • Microsoft.Data.Sqlite.csproj (meta-package): Switches from a single TargetFramework=netstandard2.0 to multi-TFM TargetFrameworks=$(NetMinimum);$(NetFrameworkToolCurrent), adds an empty CheckForAnyCPU target to suppress architecture checks, and adds a CheckNetMinimumLibDirectory build guard that fails when $(NetMinimum) is no longer net10.0.
  • lib/ placeholder files: Removes lib/netstandard2.0/_._ and adds lib/net10.0/_._ and lib/net472/_._.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Microsoft.Data.Sqlite.Core/Microsoft.Data.Sqlite.Core.csproj Replaces netstandard2.0 with $(NetFrameworkToolCurrent) (net472) in TargetFrameworks
src/Microsoft.Data.Sqlite/Microsoft.Data.Sqlite.csproj Switches to multi-TFM $(NetMinimum);$(NetFrameworkToolCurrent), adds CheckForAnyCPU override and CheckNetMinimumLibDirectory build guard
src/Microsoft.Data.Sqlite/lib/net10.0/_._ New placeholder enabling the net10.0 dependency group in the NuGet package
src/Microsoft.Data.Sqlite/lib/net472/_._ New placeholder enabling the net472 dependency group in the NuGet package

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +49 to +53
<Target Name="CheckNetMinimumLibDirectory" BeforeTargets="Build">
<Error
Condition="'$(NetMinimum)' != 'net10.0'"
Text="NetMinimum has changed to '$(NetMinimum)'. Rename the 'lib\net10.0' directory to 'lib\$(NetMinimum)'." />
</Target>
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CheckNetMinimumLibDirectory target uses BeforeTargets="Build" in a multi-TFM project (TargetFrameworks=$(NetMinimum);$(NetFrameworkToolCurrent)). In MSBuild, BeforeTargets="Build" fires in each inner per-TFM build, causing this error check to run twice (once per TFM). While this is benign since the check is idempotent, using BeforeTargets="DispatchToInnerBuilds" (which fires only once in the outer build) would be more precise and efficient, and would avoid a duplicate error message if the condition is true. Alternatively, adding a condition like Condition="'$(TargetFramework)' == '$(NetMinimum)'" ensures it runs only once.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Microsoft.Data.Sqlite.Core TFMs

4 participants